#ifndef JS_FUNCTION_EXTENSION_HPP
#define JS_FUNCTION_EXTENSION_HPP

#include "js_base.hpp"
#include "scripting/scripting_api.h"

class JsFunctionExtension final : public IFunctionalScript, JsScriptBase
{
public:
    JsFunctionExtension(std::string title, const std::string &script_path);
    ~JsFunctionExtension();
    void execute() override;
    static IScript* create(std::string title, std::string_view code, const std::string &script_path);
private:
    bool compile(const std::string_view& code) const;
};

#endif /* JS_FUNCTION_EXTENSION_HPP */
